<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
<head>
    <th:block th:include="include :: header('新增用户自定义的分类')" />
    <th:block th:include="include :: datetimepicker-css" />
</head>
<body class="white-bg">
    <div class="wrapper wrapper-content animated fadeInRight ibox-content">
        <form class="form-horizontal m" id="form-categoryuser-add">
            <div class="form-group">
                <div class="col-sm-8">
                    <input type="hidden" name="appids" id="appids">
                </div>
            </div>
        </form>
        <div class="container-div">
            <div class="row">
                <div class="col-sm-12 search-collapse">
                    <form id="formId">
                        <div class="select-list">
                            <ul>
                                <li>
                                    <label>应用编号：</label>
                                    <input type="text" name="serialNum"/>
                                </li>
                                <li>
                                    <label>应用名称：</label>
                                    <input type="text" name="name"/>
                                </li>
                                <li>
                                    <a class="btn btn-primary btn-rounded btn-sm" onclick="$.table.search()"><i class="fa fa-search"></i>&nbsp;搜索</a>
                                </li>
                            </ul>
                        </div>
                    </form>
                </div>
                <div class="col-sm-12 select-table table-striped">
                    <table id="bootstrap-table"></table>
                </div>
            </div>
        </div>
    </div>
    <th:block th:include="include :: footer" />
    <th:block th:include="include :: datetimepicker-js" />
    <script th:inline="javascript">
        var prefix = ctx + "system/categoryuser"
        $("#form-categoryuser-add").validate({
            focusCleanup: true
        });

        function submitHandler() {

            table.set();
            var rows = $.common.isEmpty(table.options.uniqueId) ? $.table.selectFirstColumns() : $.table.selectColumns(table.options.uniqueId);
            if (rows.length != 0) {
                $('#appids').val(rows.join());
                console.log($('#appids').val());
            }

            if ($.validate.form()) {
                $.operate.save(prefix + "/add", $('#form-categoryuser-add').serialize());
            }
        }

        $("input[name='addtime']").datetimepicker({
            format: "yyyy-mm-dd",
            minView: "month",
            autoclose: true
        });


        var prefix2 = ctx + "system/appsys";
        $(function() {
            var options = {
                url: prefix2 + "/list",
                uniqueId: '',
                modalName: "应用详细内容",
                pageSize: 2000,
                pagination:false,
                showRefresh:false,
                clickToSelect:true,
                columns: [
                    {
                        checkbox: true
                    },
                    {
                        field: 'id',
                        title: 'id',
                        visible: false
                    },
                    {
                        field: 'serialNum',
                        title: '应用编号：'
                    },
                    {
                        field: 'name',
                        title: '应用名称'
                    }
                    ]
            };
            $.table.init(options);
        });
    </script>
</body>
</html>
